import time

from Po.Base import Base
from selenium.webdriver.common.by import By
from selenium import webdriver


class Page7(Base):

    frame_loc=(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe")]')
    def frame(self):
        self.go_frame(self.frame_loc)
    #输入账户
    username_loc=(By.NAME,'email')
    def username(self):
        self.send_keys(self.username_loc,'grq13381144084')

    #输入密码
    password_loc=(By.NAME,'password')
    def password(self):
        self.send_keys(self.password_loc,'grq200566++')

    #点击登录按钮
    loginbtn_loc=(By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[8]/a')
    def loginbtn(self):
        self.click(self.loginbtn_loc)

    #已发送
    yifasong_loc=(By.XPATH,'/html/body/div[1]/nav/div[2]/ul/li[6]/div/span[2]')
    def yifasong(self):
        self.click(self.yifasong_loc)


    #删除
    deletea_loc=(By.XPATH,'/html/body/div[2]/div[1]/div[3]/header/div/div[2]/div/span')
    def deletea(self):
        self.click(self.deletea_loc)

    def luoji_126(self):
        self.open_url('https://www.126.com/')
        time.sleep(3)
        self.frame()
        time.sleep(2)
        self.username()
        self.password()
        time.sleep(5)
        self.loginbtn()
        self.frame_connect()
        time.sleep(3)
        self.yifasong()
        time.sleep(3)
        self.deletea()
